<template>
 <view class="bg">
	 <view class="font">
		 <text>对“减肥日记”的评价:</text>
	 </view>
    <view class="list-item">
    	<textarea 
    		:value="formData.reason"
    		class="text" maxlength="500"
    		placeholder="简单的说说两句 (至少15字)"
    		@input="bindTextAreaInput"/>
    </view>
    	<button class="submit1"  @click="formSubmit()">提交评价</button>
 </view>
</template>


<script>
	import {is_login} from '@/pages/login/login.js';
	export default{
		data(){
			return{
				formData:{
					reason:""
				}
			}
		},
		methods:{
			bindTextAreaInput: function (e) {
				this.formData.reason = e.detail.value;
			},
			formSubmit(){
				var new_function = this.formData.reason;
				if( new_function == "" || new_function ==null){
					uni.showToast({
							icon:'none',
							title:'请填入您的评价！',
							duration: 3000
						})
				}else{
					console.log('表单',new_function);
			   let token = uni.getStorageSync('token');
			   uni.request({
			 	url:'http://rwd.zanboon.com/rwd/login_user/new_function',
				data:{
					token,
					new_function,
				},
				success(res) {
					is_login(res);
				},
				fail() {
					console.log('newFunction失败');
				}
			 })
				}
			},
			}
  
	}
</script>

<style>
	*{
		margin: 0 auto;
		padding: 0px;
	}
	body{
		background-color: #FFFFFF;	
	}
	.bg{
		width: 100%;
	}
	.font{
		margin-top: 50upx;
		margin-left: 60upx;
		font-size:32upx;
		/* font-family:苹方regular; */
		font-family: 宋体;
		color: #333333;
	}
 .list-item{
	/* background: #F0F0F0; */
	margin: 30upx 0 0upx 60upx;
	font-family:苹方regular;
	height: 400upx;
	width: 84%;
	border-top: 1px solid #E6E6E6;
	border-bottom: 1px solid #E6E6E6;
 }
 .text{
  margin: 36upx 0upx 0upx 30upx;
  /* border: #FFFFFF 1upx solid; */
  font-size: 32upx;
  color: #000;
  width: 600upx;
  font-family: 苹方regular;
  line-height: 20upx;
 }
 .submit1{
	 margin-top:88upx ;
	 background-color: #FE827B;
	 height: 88upx;
	 width: 658upx;
	 font-size:36upx;
	 border-radius: 10px;
	 color:#FFFFFF;
	 font-family: 苹方regular;
 }
 .submit1:after{
	 border: none;
 }
</style>